{% extends "bugs/base.html" %}
{% block content_title %}{% endblock %}
{% block stylesheet %}{% load media %}{% media_prefix %}css/bugs-table.css{% endblock %}
{% block main %}
<script type="text/javascript">
function newDoc(value)
  {
  window.location.assign(value)
  }
</script>

  <h2>{% block listtitle %}List Title{% endblock %}</h2>
  <div id="tablecontent">
  {% if tasklist %}
  <table width="100%" cellpadding="2" cellspacing="1">
  <tr bgcolor="#B7B7DD">
  <th width="5%" align="center">#</th>
  <th width="10%">Severity</th>
  <th width="5%">Kind</th>
  <th width="15%">Status</th>
  <th width="10%">Owner</th>
  <th width="55%">Summary</th>
  </tr>
  {% for task in tasklist %}
    <tr bgcolor="{% cycle 'white' '#efefef' %}" class="table_row" onclick="newDoc('{% url homesite.bugs.views.taskinfo project.norm_name,task.id %}')">
	  <td align="center"><a href="{% url homesite.bugs.views.taskinfo project.norm_name,task.id %}">{{ task.serial }}</a></td>
	  {% ifnotequal task.status "Resolved" %}
	  <td  {% ifequal task.severity "Major" %}bgcolor="#FFEAEA"{% endifequal %}{% ifequal task.severity "Normal" %} bgcolor="#FFFFDA"{% endifequal %}{% ifequal task.severity "Minor" %}bgcolor="#DAFFDA"{% endifequal %}{% ifequal task.severity "Dream" %}bgcolor="#DADAFF"{% endifequal %}>{{ task.severity }}</td>
	  {% else %}
	  <td>{{ task.severity }}</td>
	  {% endifnotequal %}
	  <td align="center">
	  <img src="{% load media %}{% media_prefix %}img/{% ifequal task.kind 'Bug' %}Bug.gif{% else %}Feature.gif{% endifequal %}" border="0" alt=""></td>
	  <td><nobr>{{ task.status }} {% ifequal task.status "Resolved" %}({{ task.resolution }}){% endifequal %}</nobr></td>
	  <td>{{ task.owner }}</td>	  
	  <td>{{ task.summary }}</td>
    </tr>
  {% endfor %}
  </table>
  {% else %}
  <p>No tasks avalible</p>
  {% endif %}
  </div>
{% endblock %}
